<!--  -->
<template>
  <div>
    <form-view
      class="task-tab-container task-view-containner tab-container bbx-cell-form-view"
      :form-cell-count="formCellCount"
      :fields="fields"
      :value="propData"
    >
      <div slot="name"></div>
      <template slot="customer" slot-scope="{ value }">
        <div class="form-view-row bbx-form-cell-item" v-if="value">
          <label>{{$t('common.base.customer')}}</label>
          <div class="form-view-row-content link" @click="openCustomer">
            {{ propData.customerName }}
          </div>
        </div>
        <div class="form-view-row bbx-form-cell-item" v-if="value && hasLinkman">
          <label>{{ $t('common.base.contact') }}</label>
          <div class="form-view-row-content">
            {{
              propData.linkman &&
                propData.linkman.name + ' ' + propData.linkman.phone
            }}
          </div>
        </div>
        <form-address-view
          class="bbx-form-cell-item"
          v-if="value && hasAddress"
          :field="{ displayName: $t('common.base.address') }"
          :value="propData.address"
        >
        </form-address-view>
      </template>

      <template slot="createUserName">
        <div class="form-view-row bbx-form-cell-item" v-if="propData">
          <label>{{ $t('common.base.createUser') }}</label>
          <div class="form-view-row-content">
            <span v-user="propData.createUserId" class="user-card-triggle">
              <template v-if="isOpenData">
                <open-data type="userName" :openid="propData.createUserStaffId"></open-data>
              </template>
              <template v-else>
                <span>{{ propData.createUserName }}</span>
              </template>
            </span>
          </div>
        </div>
      </template>
      <!-- <template slot="createTime">
        <div class="form-view-row" v-if="propData.createTime">
          <label>{{ $t('common.base.createTime') }}</label>
          <div class="form-view-row-content">
            <span>{{ propData.createTime }}</span>
          </div>
        </div>
      </template> -->
    </form-view>
  </div>
</template>

<script>
import { isOpenData } from '@src/util/platform';
export default {
  name: 'prop-data-menu-view',
  props: {
    fields: {
      type: Object | Array,
      default: () => {
        {
        }
      },
    },
    propData: {
      type: Object,
      default: () => {
        {
        }
      },
    },
    formCellCount : {
      type: Number,
      default: 1,
    },
  },
  data() {
    return {
      isOpenData
    };
  },
  created() {},
  mounted() {},
};
</script>
<style lang="scss">
</style>
